package com.richinfo.rabbit.provider;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

/**
 * 消息生产者
 * 
* Created by WangXJ
* 2018-11-19 15:31
*/
@Component
public class Sender {

	@Resource
	private AmqpTemplate rabbitTemplate;
	
	public void send() {
		String context = "hello" + new Date();
		System.out.println("Sender : "+ context);
		rabbitTemplate.convertAndSend("hello",context);
	}
}
